<?php
session_start();
if (!isset($_SESSION["adminId"])) {
    echo "<script>window.location.href='login.html';</script>";
} else {
    $root = $_SESSION['p'];
    $root = explode(",", $root);
    $root1 = $root[0];
    $root2 = $root[1];
    $root3 = $root[2];
    $root4 = $root[3];
}


?>


<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
    <meta charset="utf-8">
    <title>易汉语平台登录 Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- CSS -->
    <link rel="stylesheet" href="css/login/reset.css">
    <link rel="stylesheet" href="css/login/supersized.css">
    <link rel="stylesheet" href="css/login/style.css">
    <style>
        body {
            display: flex;
            flex-direction: column;
        }

        @media only screen and (min-width: 1082px) and (max-width: 9920px) {
            #box {

                width: 100%;
                height: 50%;
                margin-top: 7%;
                display: flex;
                flex-direction: row;
            }

            .boxes {
                width: 20%;
                margin-left: 4%;
                position: relative;
                animation: textAnimation ease-in-out 1s;
                cursor: pointer;

            }

            .boxes:hover {
                transform: scale(1.1);
            }

            .butt {
                width: 90%;
            }

            h1 {
                font-size: 20px;

            }
        }

        @media only screen and (min-width: 920px) and (max-width: 1081px) {
            #box {

                width: 100%;
                height: 50%;
                margin-top: 150px;
                display: flex;
                flex-direction: row;
            }

            .boxes {
                width: 20%;
                margin-left: 4%;
                position: relative;
                animation: textAnimation ease-in-out 1s;
                cursor: pointer;

            }

            .boxes:hover {
                transform: scale(1.1);
            }

            .butt {
                width: 90%;
            }

            h1 {
                font-size: 18px;

            }
        }

        @media only screen and (min-width: 0px) and (max-width: 920px) {

            #box {

                width: 100%;
                margin-top: 10%;
                display: flex;
                flex-direction: column;
            }

            .boxes {
                width: 100%;
                margin-top: 5%;
                position: relative;
                animation: textAnimation ease-in-out 1s;
                border-bottom: 1px solid white;
                cursor: pointer;
            }

            .boxes:hover {
                transform: scale(1.1);
            }

            .butt {
                width: 90%;
            }
        }

        .connect {
            width: 100%;
        }

        .connect p {
            left: 0px;
            animation: textAnimation ease 2s;
        }

        .itemImg {
            width: 100%;

        }

        .imgIcon {
            width: 60%;
        }

        @keyframes textAnimation {
            0% {
                left: -140%;
            }
            100% {
                left: 0px;
            }
        }

        .header {
            width: 100%;
            text-align: center;
            /*height: 80px;*/
            margin-top: 10%;
            /*line-height: 80px;*/
            font-size: 42px;
            font-weight: bolder;
        }
        .footer {
            width: 100%;
            height: 5%;
            margin-top: 10%;
            font-size: 18px;
            color: #E6E6E6;
            display: flex;
            flex-direction: row;
            vertical-align: center;
            font-weight: bolder;
        }

        .footer > div {
            width: 50%;
        }
        .fot_left{
            text-align: right;
        }
        .fot_right{
            text-align: left;
        }
        .version{
            text-align: left;
            top: 5px;
            left: 5px;
            position: absolute;
        }
    </style>
</head>

<body>
<a class="version">V2.0</a>
<div id="header" class="header "><span class="header_title">国别化（泰国）汉语教学资源库及中国文化传播平台</span></div>
<div id="box">

    <input id="p" name="p" style="display: none" value="<?php echo $_SESSION["p"] ?>">
    <div class="boxes" id="resourses">
        <h1>资源汇集与管理子平台</h1>
        <div class="itemImg">
            <img class="imgIcon" src="images/reasource.png"/>
            <button class="butt" id="resourses" type="button">立即进入</button>
        </div>

    </div>
    <div class="boxes" id="cloudEdu">
        <h1>云教育服务子平台</h1>
        <div class="itemImg">
            <img class="imgIcon" src="images/clound.png"/>
            <button class="butt" id="cloudEdu" type="button">立即进入</button>
        </div>


    </div>
    <div class="boxes" id="dataBut">
        <h1>智能分析子平台</h1>
        <div class="itemImg">
            <img class="imgIcon" src="images/data.png"/>
            <button class="butt" id="dataBut" type="button">立即进入</button>
        </div>


    </div>
    <div class="boxes" id="teach">
        <h1>教师管理子平台</h1>
        <div class="itemImg">
            <img class="imgIcon" src="images/teacher.png"/>
            <button class="butt" id="teach" type="button">立即进入</button>
        </div>


    </div>
</div>
<div id="footer" class="footer">
    <div class="fot_left"><a>重庆西南师范大学出版社有限公司</a><br>Chongqing Southwest Normal University Press Ltd.</a></div>
    &nbsp;&nbsp;
    <div class="fot_right"><a>成都乐知软件有限公司</a><br>Chengdu lezhi soft co., ltd.</div>
</div>
<!-- Javascript -->
<script src="js/login/jquery.min.js" type="text/javascript"></script>
<script src="js/login/supersized.3.2.7.min.js"></script>
<script src="js/login/supersized-init.js"></script>
<script type="text/javascript" src="js/config.js"></script>

<script>
    $(document).ready(function () {
        $p = $("#p").val();
        var root = $p.split(",");
        //点击资源分析平台
        $("#resourses").click(function () {
            var id = "#resourses";
            var status = show(root[0], id);
            if (status) {
                window.location.href = "index.php?id=1";
            }

        });
        //点击云教育服务平台
        $("#cloudEdu").click(function () {
            var id = "#cloudEdu";
            var status = show(root[1], id);
            if (status) {
                window.location.href = "index.php?id=2";
            }
        });
        //点击智能分析平台的操作
        $("#dataBut").click(function () {
            var id = "#dataBut";
            var status = show(root[2], id);
            if (status) {

                window.location.href = "index.php?id=3";
            }

        });
        //点击教师管理的子平台
        $("#teach").click(function () {
            var id = "#teach";
            var status = show(root[3], id);
            if (status) {
                window.location.href = "http://xs.lz06.com/index_teacher.php";
            }
        });


    });

    //判断用户权限
    function show(val, id) {
        if (val == "1") {
            console.log("被允许");
            return true;
        }
        else {
            $(id).css({"cursor": "not-allowed"});
            return false;
        }
    }

</script>
</body>

</html>

